﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NBusiness.Query;

namespace NBusiness.Data.Providers.SqlServer.Query
{
    public class SqlAssignment : IAssignment
    {
        public SqlAssignment(IEvaluatable left, IEvaluatable right)
        {
            Left = left;
            Right = right;
        }

        #region IAssignment Members

        public IEvaluatable Left { get; private set; }

        public IEvaluatable Right { get; private set; }

        #endregion

        #region IRelationalElement Members

        public string ToSql()
        {
            return ToSql(new SqlQueryContext());
        }

        public string ToSql(IQueryContext context)
        {
            return string.Format("{0}={1}", Left.ToSql(context), Right.ToSql(context));
        }

        #endregion
    }
}
